package org.apache.ibatis;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.Reader;

/**
 * @version 1.0
 * @Author: xpH
 * @Description: 我的测试语句
 * @Date: Created in 11:04 2021/3/10
 */
public class MyRunMybatis {
  public static void main(String[] args) {
    String resource = "mybatis/Configuration.xml";
    Reader reader = null;
    try {
      // 通过Resources.getResourceAsReader 得到配置文件的字节流
      reader = Resources.getResourceAsReader(resource);
    } catch (IOException e) {
      e.printStackTrace();
    }
    SqlSessionFactory sessionFactory = new SqlSessionFactoryBuilder().build(reader);
    sessionFactory
  }
}
